package com.lightboat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单类别（1系统 2复购）
 */
@Getter
@AllArgsConstructor
public enum OrderType {
    SYSTEM(1, "系统"),
    REPURCHASE(2, "复购");
    private final Integer type;
    private final String message;

    public static OrderType getByType(Integer type) {
        for (OrderType value : OrderType.values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }
}
